
#
# Makefile for ComboDemo2 example
#

SHELL = /bin/sh

#----------------------------------------------------------- SETUP

TOPDIR = ../..
include $(TOPDIR)/Makefile.common

JAVACOPTIONS =
JAVAOPTIONS  = -Xms36m

JAVAC = javac -classpath $(SSFNET_TEST_CLASSPATH)
JAVA  = java $(JAVAOPTIONS) -classpath $(SSFNET_TEST_CLASSPATH)

SCHEMAS = $(TOPDIR)/examples/net.dml


EXAMPLENAME = ComboDemo2

#----------------------------------------------------------- MAKE EXAMPLE

all:
	$(JAVA) SSF.Net.Net 300 $(EXAMPLENAME).dml $(SCHEMAS) > $(EXAMPLENAME)-raw.out 2>&1
	@echo 'Reading SSFNET simulation output ...'
	@rm -f .successes.out
	@rm -f .sorted.out
	@grep SUCCESS $(EXAMPLENAME)-raw.out > .successes.out
	@sort -n .successes.out > .sorted.out
	@echo 'Verifying SSFNET simulation output ...'
	@if [ -z "`diff .$(EXAMPLENAME).verify .sorted.out`" ]; \
	then \
	 echo 'Verification complete!  266/266 transfers satisfied (100%).'; \
	else \
	 echo 'Uh oh!  Verification failed!'; \
	fi
	@rm -f .successes.out
	@rm -f .sorted.out

clean:
	@rm -f .successes.out .sorted.out $(EXAMPLENAME)-raw.out
	@echo 'Done.'

spotless: clean
	@find . \( -name "*.class" -o -name ".*~" -o -name "*~" \) -exec rm -f {} \;
	@echo 'Done.'
